package com.tgy.myplus.service.impl;

import com.tgy.myplus.dao.PictureDao;
import com.tgy.myplus.entity.Picture;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("pictureService")
public class PictureServiceImpl {
    @Autowired
    PictureDao pictureDao;

    public int insert(Picture picture){
        try {
            return this.pictureDao.insert(picture);
        } catch (Exception e) {
            e.printStackTrace();
            return 404;
        }
    }
    public List<Picture> queryAll(){
        return this.pictureDao.selectList(null);
    }

    public Picture queryById(int id){
        return this.pictureDao.selectById(id);
    }

}
